<%-------------------------------------------------------------------
 * 页面名称：peerBankAccountAdd.jsp
 * 功能描述：联系人->银行账户->添加
 * Action  : /peerBankAccountAdd.do
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ipb" uri="/WEB-INF/conf/tld/ipb.tld"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%
String path = request.getContextPath();
%>
<script type='text/javascript' src='<%=path%>/js/ufront.js'></script>
<script language="javascript" type="text/javascript"
	src="<%=path%>/js/choiceCity.js"></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/AccountLogic.js'></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/accountTemplate.js'></script>
<SCRIPT LANGUAGE="JavaScript">
	function update() {
		AccountLogic.getCityList(createList, $("provSeq").value);
	}
	function createList(data) {
  		DWRUtil.removeAllOptions("citySeq");
  		DWRUtil.addOptions("citySeq", data,'cityId','cityName');
	}
	function dosubmit() {
		var formObj = document.PeerBankAccountForm;
		if (checkNecessaryInput(formObj) && checkInputMaxlength(formObj) && numberValidate(formObj.cardNo) && numberValidate(formObj.cardNo2)) {
			if (formObj.cardNo.value!=formObj.cardNo2.value) {
				alert("银行账号和重复银行账号不同！");
				formObj.cardNo2.focus();
				return;
			}
			
			if (!checkEmail(formObj.peerEmail)) {
				alert("请输入正确的收款方Email！");
				formObj.peerEmail.focus();
				return;
			}
			
			if (mobileValidate(formObj.peerMobile)) {
				formObj.submit();
			}
		}
	}
</SCRIPT>
<div id="main">
	<div class="content_right">
		<div style="width:745px;margin-left:10px;">
			<div class="titleinfo">
				新增银行账户
			</div>
			<div class="edit_pass">
				<html:form action="/peerBankAccountAdd.do" method="post">
					<table width="100%" border="0" align="center" cellpadding="5"
						cellspacing="1">
						<tr>
							<td width="22%" align="right">
								<span class="orang12b">*</span> 收款方姓名：
							</td>
							<td width="78%">
								<a href="#" class="menuTextBlue"> <html:text
										property="peerName" alt="收款方姓名" maxlength="255" size="35"
										styleClass="inputStyle" /> </a>
							</td>
						</tr>
						<tr>
							<td align="right">
								<span class="orang12b">*</span> 银行名称：
							</td>
							<td>
								<html:select property="bankSeq" alt="银行名称">
									<html:option value="">请选择</html:option>
									<html:options collection="bankList" property="id"
										labelProperty="bankName" />
								</html:select>
							</td>
						</tr>
						<tr>
							<td align="right">
								<span class="orang12b">*</span> 开户行省份：
							</td>
							<td>
								<html:select property="provSeq" styleId="provSeq" onchange="update()" alt="开户行省份">
									<html:option value="">请选择</html:option>
									<html:options collection="province" property="cityId"
										labelProperty="cityName" />
								</html:select>
							</td>
						</tr>
						<tr>
							<td align="right">
								<span class="orang12b">*</span> 开户行城市：
							</td>
							<td>
								<html:select property="citySeq" styleId="citySeq" alt="开户行城市">
									<html:option value="">请选择</html:option>
								</html:select>
							</td>
						</tr>
						<tr>
							<td align="right">
								<span class="orang12b">*</span> 开户行名称：
							</td>
							<td>
								<html:text property="bankName" alt="开户行名称" maxlength="255"
									size="35" styleClass="inputStyle" />
							</td>
						</tr>
						<tr>
							<td align="right">
								<span class="orang12b">*</span> 银行账号：
							</td>
							<td>
								<html:text property="cardNo" alt="银行账号" size="35"
									styleClass="inputStyle" />
								<span class="font_gray">(为数字，且长度应该在6位到32位之间。)</span>
							</td>
						</tr>
						<tr>
							<td align="right" valign="top">
								<span class="orang12b">*</span> 重复银行账号：
							</td>
							<td>
								<input type="text" name="cardNo2" alt="重复银行账号" size="35"
									class="inputStyle" />
							<table width="100%" border="0" align="center" cellpadding="7"
										cellspacing="1" bgcolor="#f9e277" style="margin:10px 0;">
										<tr>
											<td bgcolor="#fffdf5">
												<table width="100%" border="0" cellpadding="3"
													cellspacing="0">
													<tr>
														<td width="3%" height="25" valign="top"
															style="border-bottom:1px solid #ccc;"></td>
														<td width="97%" align="left" class="red12b"
															style="border-bottom:1px solid #ccc;">
															特别提醒
														</td>
													</tr>
												<tr>
													<td valign="top">
														&nbsp;
													</td>
													<td align="left" class="font_gray">
														<span class="text9green">银行账号/银行卡号为数字，且长度应该在6位到32位之间！</span>
													</td>
												</tr>
												<tr>
													<td valign="top">
														&nbsp;
													</td>
													<td align="left" class="font_gray">
														<span class="text9green"> 存折账号的<span class="redColor12px">'*'</span>和企业账户的<span class="redColor12px">'-'</span>在此均</span>
														<span class="redColor12px">无需输入</span>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td align="right">
								收款方Email：
							</td>
							<td>
								<html:text property="peerEmail" title="收款方Email" maxlength="255"
									size="35" styleClass="inputStyle" />
								<span class="font_gray">(可选)</span>
							</td>
						</tr>
						<tr>
							<td align="right">
								收款方电话：
							</td>
							<td>
								<html:text property="peerPhone" title="收款方电话" maxlength="32"
									size="35" styleClass="inputStyle" />
								<span class="font_gray">(可选)</span>
							</td>
						</tr>
						<tr>
							<td align="right">
								收款方手机：
							</td>
							<td>
								<html:text property="peerMobile" title="收款方手机" maxlength="32"
									size="35" styleClass="inputStyle" />
								<span class="font_gray">(可选)</span>
							</td>
						</tr>
						<tr>
							<td align="right" valign="top">
								备注：
							</td>
							<td>
								<html:textarea property="remark" cols="45" rows="5"
									style="border:1px solid #ccc;" title="maxlength:100;title:备注"></html:textarea>
								<br />
								<span class="font_gray">可选(100个字) </span>
							</td>
						</tr>
						<tr>
							<td height="55" align="right" valign="top">
								&nbsp;
							</td>
							<td>
								<input name="confirm" type="button" class="button_style"
									value="确 定" onclick="dosubmit();" />
								<input name="return" type="button" class="button_style"
									onclick="location.href='<%=path%>/page/myspace/getPeerBankAccountList.do';"
									value="返 回" />
							</td>
						</tr>
					</table>
				</html:form>
			</div>
		</div>
	</div>
</div>
